package com.example.springbootstartermqttprovider.test;

import okhttp3.*;

import java.io.IOException;

public class RESTUTILSDETAIL {

    public static void main(String[] args) {
        OkHttpClient client = new OkHttpClient().newBuilder()
                .build();
        MediaType mediaType = MediaType.parse("application/json");
        RequestBody body = RequestBody.create(mediaType, "[\r\n    {\r\n        \"companyId\": \"2c9e078a95fa7c0801960e393f4000ae\",\r\n        \"bikeType\": 2,\r\n        \"bikeNo\": \"8660468026\",\r\n        \"cityCode\": \"360300\",\r\n        \"adCode\": \"360302\",\r\n        \"rideStatus\": 1,\r\n        \"uploadTime\": \"2025-04-15 02:08:47\",\r\n        \"point\": {\r\n            \"lng\": 113.84199196844355,\r\n            \"lat\": 27.643087934881\r\n        }\r\n    },\r\n    {\r\n        \"companyId\": \"2c9e078a95fa7c0801960e393f4000ae\",\r\n        \"bikeType\": 2,\r\n        \"bikeNo\": \"8660465032\",\r\n        \"cityCode\": \"360300\",\r\n        \"adCode\": \"360302\",\r\n        \"rideStatus\": 1,\r\n        \"uploadTime\": \"2025-04-15 02:08:48\",\r\n        \"point\": {\r\n            \"lng\": 113.89500407981649,\r\n            \"lat\": 27.654771258309527\r\n        }\r\n    },\r\n    {\r\n        \"companyId\": \"2c9e078a95fa7c0801960e393f4000ae\",\r\n        \"bikeType\": 2,\r\n        \"bikeNo\": \"8660468026\",\r\n        \"cityCode\": \"360300\",\r\n        \"adCode\": \"360302\",\r\n        \"rideStatus\": 1,\r\n        \"uploadTime\": \"2025-04-15 02:08:48\",\r\n        \"point\": {\r\n            \"lng\": 113.84200013585301,\r\n            \"lat\": 27.643076158893066\r\n        }\r\n    },\r\n    {\r\n        \"companyId\": \"2c9e078a95fa7c0801960e393f4000ae\",\r\n        \"bikeType\": 2,\r\n        \"bikeNo\": \"8660600530\",\r\n        \"cityCode\": \"360300\",\r\n        \"adCode\": \"360302\",\r\n        \"rideStatus\": 0,\r\n        \"uploadTime\": \"2025-04-15 02:08:49\",\r\n        \"point\": {\r\n            \"lng\": 113.86846480626863,\r\n            \"lat\": 27.63939447906751\r\n        }\r\n    },\r\n    {\r\n        \"companyId\": \"2c9e078a95fa7c0801960e393f4000ae\",\r\n        \"bikeType\": 2,\r\n        \"bikeNo\": \"8660494926\",\r\n        \"cityCode\": \"360300\",\r\n        \"adCode\": \"360302\",\r\n        \"rideStatus\": 1,\r\n        \"uploadTime\": \"2025-04-15 02:08:52\",\r\n        \"point\": {\r\n            \"lng\": 113.83849239557132,\r\n            \"lat\": 27.63169423433325\r\n        }\r\n    },\r\n    {\r\n        \"companyId\": \"2c9e078a95fa7c0801960e393f4000ae\",\r\n        \"bikeType\": 2,\r\n        \"bikeNo\": \"8660600530\",\r\n        \"cityCode\": \"360300\",\r\n        \"adCode\": \"360302\",\r\n        \"rideStatus\": 0,\r\n        \"uploadTime\": \"2025-04-15 02:08:52\",\r\n        \"point\": {\r\n            \"lng\": 113.86850970138583,\r\n            \"lat\": 27.639375416646796\r\n        }\r\n    },\r\n    {\r\n        \"companyId\": \"2c9e078a95fa7c0801960e393f4000ae\",\r\n        \"bikeType\": 2,\r\n        \"bikeNo\": \"8660601027\",\r\n        \"cityCode\": \"360300\",\r\n        \"adCode\": \"360302\",\r\n        \"rideStatus\": 1,\r\n        \"uploadTime\": \"2025-04-15 02:08:52\",\r\n        \"point\": {\r\n            \"lng\": 113.8562024578052,\r\n            \"lat\": 27.62278774155835\r\n        }\r\n    },\r\n    {\r\n        \"companyId\": \"2c9e078a95fa7c0801960e393f4000ae\",\r\n        \"bikeType\": 2,\r\n        \"bikeNo\": \"8660600003\",\r\n        \"cityCode\": \"360300\",\r\n        \"adCode\": \"360302\",\r\n        \"rideStatus\": 0,\r\n        \"uploadTime\": \"2025-04-15 02:08:53\",\r\n        \"point\": {\r\n            \"lng\": 113.87192929988429,\r\n            \"lat\": 27.630286254275585\r\n        }\r\n    },\r\n    {\r\n        \"companyId\": \"2c9e078a95fa7c0801960e393f4000ae\",\r\n        \"bikeType\": 2,\r\n        \"bikeNo\": \"8660494926\",\r\n        \"cityCode\": \"360300\",\r\n        \"adCode\": \"360302\",\r\n        \"rideStatus\": 1,\r\n        \"uploadTime\": \"2025-04-15 02:08:53\",\r\n        \"point\": {\r\n            \"lng\": 113.83849239557132,\r\n            \"lat\": 27.63169423433325\r\n        }\r\n    },\r\n    {\r\n        \"companyId\": \"2c9e078a95fa7c0801960e393f4000ae\",\r\n        \"bikeType\": 2,\r\n        \"bikeNo\": \"8660601027\",\r\n        \"cityCode\": \"360300\",\r\n        \"adCode\": \"360302\",\r\n        \"rideStatus\": 1,\r\n        \"uploadTime\": \"2025-04-15 02:08:54\",\r\n        \"point\": {\r\n            \"lng\": 113.85619942729247,\r\n            \"lat\": 27.622781638366565\r\n        }\r\n    },\r\n    {\r\n        \"companyId\": \"2c9e078a95fa7c0801960e393f4000ae\",\r\n        \"bikeType\": 2,\r\n        \"bikeNo\": \"8660600627\",\r\n        \"cityCode\": \"360300\",\r\n        \"adCode\": \"360302\",\r\n        \"rideStatus\": 1,\r\n        \"uploadTime\": \"2025-04-15 02:08:54\",\r\n        \"point\": {\r\n            \"lng\": 113.83976330246924,\r\n            \"lat\": 27.64231149381858\r\n        }\r\n    },\r\n    {\r\n        \"companyId\": \"2c9e078a95fa7c0801960e393f4000ae\",\r\n        \"bikeType\": 2,\r\n        \"bikeNo\": \"8660600227\",\r\n        \"cityCode\": \"360300\",\r\n        \"adCode\": \"360302\",\r\n        \"rideStatus\": 1,\r\n        \"uploadTime\": \"2025-04-15 02:08:55\",\r\n        \"point\": {\r\n            \"lng\": 113.89758891269022,\r\n            \"lat\": 27.662019325288632\r\n        }\r\n    }\r\n]");
        Request request = new Request.Builder()
                .url("http://gxdc.bikemgt.com/gxdc/heartbeatInfo")
                .method("POST", body)
                .addHeader("token", "731533282d3345ff8bffd22dfc4c6ac6")
                .addHeader("User-Agent", "Apifox/1.0.0 (https://apifox.com)")
                .addHeader("Content-Type", "application/json")
                .build();
        try {
            Response response = client.newCall(request).execute();
            System.out.println(response.body().string());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
